(ns cyberdelia.core
  (:require [cyberdelia.input :as input])
  (:require [cyberdelia.player :as player])
  (:require [clojure.pprint :as pp])
  (:gen-class))

(def players (atom {}))

; TODO use something else for unique key
(defn- add-player [name]
  "add a player to players"
  (let [p (player/new-player name)]
    (swap! players assoc (keyword name) p)
    p))

(defn- get-player [name]
  (@players (keyword name)))

(defn -main
  "pretend game loop"
  [& args]
  (println "./cyberdelia\n\n")

  (println "./what's yer name?\n")
  (let [name (read-line)])

  (loop [input (read-line)]
    (when-not (= "quit" input)
      (pp/pprint (input/parse input))
      (recur (read-line)))))
